package vue;

import java.util.HashMap;

import modele.Alien1;
import modele.Alien2;
import modele.Alien3;
import modele.Alien4;
import modele.Alien5;
import modele.Missile;
import modele.Tank;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;

public class TextureFactory {

	static private TextureFactory instance;
	private HashMap<Class<?>, iTexturable> textures;

	private TextureFactory(){

		textures = new HashMap<Class<?>, iTexturable>();

		textures.put(Tank.class,new TextureUnique(new Texture(Gdx.files.internal("tank.png"))));
		textures.put(Missile.class,new TextureUnique(new Texture(Gdx.files.internal("missile.png"))));
		textures.put(Alien1.class,new TextureUnique(new Texture(Gdx.files.internal("alien1.png"))));
		textures.put(Alien2.class,new TextureUnique(new Texture(Gdx.files.internal("alien2.png"))));
		textures.put(Alien3.class,new TextureUnique(new Texture(Gdx.files.internal("alien3.png"))));
		textures.put(Alien4.class,new TextureUnique(new Texture(Gdx.files.internal("alien4.png"))));
		textures.put(Alien5.class,new TextureUnique(new Texture(Gdx.files.internal("alien5.png"))));

	}


	static public TextureFactory getInstance()
	{
		if (instance == null)
			instance = new TextureFactory();
		return instance;

	}

	public Texture getTexture (Class<?> c)
	{

		return textures.get(c).getTexture();

	}

	public iTexturable getTexturable (Class <?> c)
	{
		return textures.get(c);
	}


}
